﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Frogs.Stability.CircuitBreaker
{
    /// <summary>
    /// Defines a Circuit Breaker for accepting a function
    /// </summary>
    public interface IFunctionCircuitBreaker : ICircuitBreaker
    {
        /// <summary>
        /// Attempt to perform the supplied function within the constraints of a circuit breaker.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="function"></param>
        /// <returns></returns>
        T Do<T>(Func<T> function);
    }
}
